package com.dongdongshop.config;

import java.io.FileWriter;
import java.io.IOException;

public class AlipayConfig {

    //↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2016101100663987";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCHRmfGmjwwbQ6eN2/TDYx0zqn+ehvBPML5Hj/tZUzD5SYczpgZ0cthdlqqRDNmzGykwtqlHkcFHAvuoM3ilNrYQTSjtswNOkANxtwdMzBf/4pTfkeYQBu9F53u5ym21IHPeiHivqYyhb6tmadDDDlsplXr+gxd7Xc1Zv11Ad51+UbSoW5nKT08RTPkPPh1xzuQ2UJiWu0/uELy/fn1WGRbxatmzWWwH9mOta5W45Y3WfyF4O8L2vfKdfRIFK/qryRR0eQXJDKKHuSLXdZaM/ytVU1OGbEew04QZSAKZss9XSLoPJWLGp6rz/IoUl9A98vNRtbmmZQSPuDuriCHkH8JAgMBAAECggEAHBtb2p8XXHR8chFQsciB449BMPfMJoVqeXp4i+ndXmKRXbDrV4oIuRJvWitbhsN4228FIQO+e+hM7mMJBEgrhH1f45hKo4Dz6CjmeUa2iWu+IQT++TpwyQRMM2RifXOAGUzmF4fHXn39lXJ0l3DFybZx6dsFkMqTV0wz44jk4Rv+XSYHhX1XvbV1FDFfGaIlaKeW76PG1mfNHGLw3UXVojQO0omBk+cRj19PlDBnN5xAzdXxJnnRnFjS82y+BaNp8oHzovjbN4I00dt/OOmY1Qi9Qmd2/ImhbU8dL8wnVWV+j0Zf1CcTyxV3fxmo+Q8eYIbldRXOzsDAkZu6iXMEBQKBgQD74VQ6WRpXgQcedZZL6Pp3m46Sx1DwHggq8m4BoVfpzAghMPcjHhijhRLe61rQxOaeVhBF/HkkMpmFdUYggViHU0doeo2ZFZQPX2k/Cjiz/Y3nj5arKT7gl7oAx2mBE9p+V9Ij2zPvToOLkfkZc1Qs0vtaGXk+ir4A/P/xlHkqawKBgQCJfNP32PNeq8kASe0X6rhd2+SXN7lPE9bLFnakROk+YcLlvIhxzqVnlhMajet7iz0yfmw7HBKe0YM4nkkNg9HC4LnbMUS4xOxcb8x9NdWJzE59KpReTONjIeo5eHgWykXJt6JHOgulmqz3L7w3QeDE8Q8VU4XRlIV0uIEBEvwBWwKBgQCpfp7USMNuINhuicgiuttZA2e0o8V2X281nz+hfzYOkQrjcvTLP+RqnRDuy0eodueNovJ+df/6+MXQRfNzyjaNkd/akaWZXyjsE1NaZYF0tWn5aemEslOqhM9Y2NfJUVfVbzlsgYR4Q8hHcmpC0xXQuAUGQ2AQUwK63YVJxpSmkwKBgCcyS0wRsfB/kSJf8RQsertngVgLLu14fngPw2s5qjV6sZHFmjC39Tf+9RtQ8p2aKKxIlpqTekuE96AgoDsWJaslXlc7SJhUq/3+cZIQ0vwiHw5YIUxxJzKP7LLNwY7dw9+qVr1vsvpXipA+L66hPW9oOiCeWzxQ12tbXovr2aSZAoGBALHB+kyWHTQW7bzEZ2/zUZBQykjhkinYAcjQfkap8lA2n43eTNcteZoHxFUPHvV5Js5lfsT+uLLWJDJ4uyRSHBSI7991dFYFOz3E0SBtt9RXi+zzEASXc4kZgJ9+j4g8OI6DHSXGZTWrGzs8wU4I/jYK7ACFtxK70r2V9rhUk6HE";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApHvzZLso2c+S8BQa58LZtrCpoK3eTJuKcUJyb7C1OavMe5ASlxY+4N6Vi70q5gJ/SQks6W51WTxuDbI1fSu3Z9M98GqMcISG3teTRbyM40nX/lSqZXs8BmJyoYoKlGZ46U6Oiezca3QzPlDO20CR8n2kI4nNT7zxR1qsFRvGAS/s41fB/Kmh+OQ6oZlGtIWOspntoVdqDzNuuRd7lcSXZTIJiRa+10UEq+zVwdZ2W5CGKqD8pDBFotm4jEXg9KpViB0ccBKSVQaj7l66UFkiNCBSg4aPmxNvvwqBWL+0InUO7uAjUWDliV3wxkIpP8Ut+eeOPB+9EmFPk/rPar4aBQIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://2y669249o3.wicp.vip/callback/notifyUrl";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://2y669249o3.wicp.vip/callback/returnUrl";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }

}
